# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Tom K <tomk@runbox.com>

pkgname=ekiga
pkgver=4.0.1
pkgrel=33
pkgdesc="VOIP/Videoconferencing app with full SIP and H.323 support (GnomeMeeting expanded and renamed)"
url="https://www.ekiga.org"
license=(GPL)
arch=(x86_64)
depends=('opal' 'boost-libs' 'libxv' 'libnotify' 'avahi' 'gtk2' 'gconf' 'gnome-icon-theme')
makedepends=('intltool' 'gnome-doc-utils' 'evolution-data-server' 'boost' 'python')
optdepends=('evolution-data-server: Evolution integration')
options=(!emptydirs)
source=(https://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz
        ekiga-4.0.1-boost-signals2.patch
        ekiga-4.0.1-libresolv.patch)
sha256sums=('5f4f491c9496cf65ba057a9345d6bb0278f4eca07bcda5baeecf50bfcd9a4a3b'
            '940da15bd16f2ca32637033e91138048b3d1bb4e02a0033a9096f93d0f3b6d7a'
            '5b0e4a8fd7d575f620ff1cbaaf126fcb5d9a48da948b032526084911ed41b63f')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../ekiga-4.0.1-boost-signals2.patch
  patch -Np1 -i ../ekiga-4.0.1-libresolv.patch
  autoreconf -fi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-schemas-install \
      --disable-scrollkeeper --enable-dbus --enable-avahi
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 install

  install -m755 -d "$pkgdir/usr/share/gconf/schemas"
  gconf-merge-schema "$pkgdir/usr/share/gconf/schemas/$pkgname.schemas" --domain ekiga "$pkgdir"/etc/gconf/schemas/*.schemas
  rm -f "$pkgdir"/etc/gconf/schemas/*.schemas
}
